package model

import "gorm.io/gorm"

// 车型表
type Car struct {
	gorm.Model
	Name  string  `gorm:"type:varchar(10);not null;comment:名称"`
	Type  string  `gorm:"type:varchar(10);not null;comment:车类型"`
	Image string  `gorm:"type:varchar(100);not null;comment:图片"`
	Nums  int32   `gorm:"type:int;comment:数量"`
	Price float32 `gorm:"type:decimal(10,2);comment:价格"`
}

// 订单表
type Order struct {
	gorm.Model
	UserId  int     `gorm:"type:int;index;comment:用户ID"`
	CarId   int     `gorm:"type:int;index;comment:车型ID"`
	OrderSn string  `gorm:"type:varchar(100);comment:订单编号"`
	Status  string  `gorm:"type:varchar(100);comment:订单状态"`
	TradeNo string  `gorm:"type:varchar(100);comment:支付编号"`
	Price   float32 `gorm:"type:decimal(10,2);comment:价格"`
	PayType int     `gorm:"type:int;comment:支付方式,1(支付宝),2(微信),3(余额)"`
}
